/**
 * 
 */
package stc.skymobi.transport.protocol.esb.test;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import stc.skymobi.bean.esb.annotation.EsbField;
import stc.skymobi.bean.esb.annotation.EsbSignal;
import stc.skymobi.bean.esb.core.AbstractEsbA2MSignal;


/**
 * @author Marvin.Ma
 *
 */
@EsbSignal(messageCode=100)
public class EsbA2MDemoSignal extends AbstractEsbA2MSignal {
	
	@EsbField(index = 1)
	private	int	skyid;
	
	@EsbField(tag=100, index = 1000)
	private	String	name;
	
	@EsbField(tag=101, index = 1001)
	private	String	desc;
	
    public String toString() {
        
        return  ToStringBuilder.reflectionToString(this, 
                            ToStringStyle.SHORT_PREFIX_STYLE);
    }

	/**
	 * @return the skyid
	 */
	public int getSkyid() {
		return skyid;
	}

	/**
	 * @param skyid the skyid to set
	 */
	public void setSkyid(int skyid) {
		this.skyid = skyid;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}


	/**
	 * @return the desc
	 */
	public String getDesc() {
		return desc;
	}

	/**
	 * @param desc the desc to set
	 */
	public void setDesc(String desc) {
		this.desc = desc;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((desc == null) ? 0 : desc.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + skyid;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		EsbA2MDemoSignal other = (EsbA2MDemoSignal) obj;
		if (desc == null) {
			if (other.desc != null)
				return false;
		} else if (!desc.equals(other.desc))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (skyid != other.skyid)
			return false;
		return true;
	}
	
}
